<?php
namespace GRH\Form;

use Zend\Form\Form;
use Zend\Form\Element;

class CodeActiviteForm extends Form
{
    public function __construct($name = 'code_activite')
    {
        parent::__construct($name);
        $this->setAttribute('method', 'post');
        
        // code_activite_id
        $code_activite_id = new Element\Hidden('code_activite_id');
        
        // code
        $code = new Element\Text('code');
        $code->setLabel('Code');
        
        // libelle
        $libelle = new Element\Text('libelle');
        $libelle->setLabel('Libellé');
        
        // paye
        $paye = new Element\Checkbox('paye');
        $paye->setLabel('Payé');
        $paye->useHiddenElement(true);
        $paye->setChecked('1');
        $paye->setUncheckedValue('0');
        
        // coefficient
        $coefficient = new Element\Text('coefficient');
        $coefficient->setLabel('Coefficient');
        
        // couleur
        $couleur = new Element\Select('couleur');
        $couleur->setLabel('Couleur');
        
        // description
        $description = new Element\Textarea('description');
        $description->setLabel('Description');
        
        $this->add($code_activite_id);
        $this->add($code);
        $this->add($libelle);
        $this->add($paye);
        $this->add($coefficient);
        $this->add($couleur);
        $this->add($description);
    }
}